﻿@using MFTool;
<html>
<head>
    <title></title>
    <script type="text/javascript" src="@Url.Content("/BaseResource/Plugin/insdepui/expand/jquery-easyui-portal/jquery.portal.js")"></script>
    <style>
        .panelColorBlue {
            background-color:blue;
            color:white;
        }
        .panelColorGreen {
            background-color:green;
            color:white;
        }
        .panelColorRed {
            background-color:red;
            color:white;
        }
        .panelColorBrown {
            background-color:brown;
            color:white;
        }

        /*.portal-column-left 
        {
            box-shadow:-1px 16px 7px 5px #888888;
        }*/
    </style>
</head>
<body style="height:100%;">
    <div id="configPanel" style="height:100%;position:relative;">
        @foreach (var dic in ViewBag.DefineHomeColTable as List<Dictionary<string, object>>)
        {
            <div style="width:@dic.GetValue("Width")%">
                @{var panelDics = dic.GetValue("DefineHomePanelJson").JsonToDictionaryList();}
                @foreach (var panelDic in panelDics)
                {
                    if (panelDic.GetValue("Enable") == "是")
                    {
                        var collapsible = (panelDic.GetValue("Collapsible") == "是").ToString().ToLower();
                        var closable = (panelDic.GetValue("Closable") == "是").ToString().ToLower();
                        var border = (panelDic.GetValue("Border") == "是").ToString().ToLower();
                        var headerCls = "panelColor" + panelDic.GetValue("HeaderColor");
                        if (panelDic.GetValue("Url").Contains("www.") || panelDic.GetValue("Url").Contains("http"))
                        { 
                            <div title="@panelDic.GetValue("Title")" style="height:@panelDic.GetValue("Height")px;" collapsible="@collapsible" closable="@closable" border="@border" headercls="@headerCls">
                                <iframe scrolling="auto" frameborder="0" src="@panelDic.GetValue("Url")" style="width:100%;height:99%;"></iframe>
                            </div>
                        }
                        else
                        {
                            <div title="@panelDic.GetValue("Title")" style="height:@panelDic.GetValue("Height")px;" href="@panelDic.GetValue("Url")"
                                 collapsible="@collapsible" closable="@closable" border="@border" headercls="@headerCls">
                            </div>
                        }
                    }
                }
            </div>
        }
    </div>
</body>
</html>
<script>
    $(function () {
        $("#configPanel").niceScroll();

        $('#configPanel').portal({
            border: false,
            fit: true
        });
    });
</script>
